package com.power.ding.model;


import com.fasterxml.jackson.annotation.JsonFormat;
import com.plf.core.common.domain.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.Date;
import java.util.Map;

/**
 * 部门信息实体类
 */

@Entity
@ApiModel(value = "部门信息")
@Data
@Table(name = "Di_dept")
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
//@IdClass(Di_dept.Di_deptPK.class) 用于复合组件
public class Di_dept extends BaseModel implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @Setter(AccessLevel.NONE)
    @ApiModelProperty(value = "序号")
    private String id;

    /**
     * -1已删除；>=0正常
     */
    @ApiModelProperty(value = "删除标识")
    private Integer rowState;

    @ApiModelProperty(value = "最后修改时间", example = "2020-10-22 10:03:22")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date lastUpdateTime;

    @ApiModelProperty(value = "父ID")
    private String fId;

    @ApiModelProperty(value = "父名称")
    private String fIdText;

    @ApiModelProperty(value = "层级")
    private String step;

    @ApiModelProperty(value = "机构名称")
    private String orgname;

    @ApiModelProperty(value = "组织机构全称")
    private String fullName;

    @ApiModelProperty(value = "地址")
    private String address;

    @ApiModelProperty(value = "联系电话")
    private String tel;

    @ApiModelProperty(value = "邮编")
    private String zipCode;

    @ApiModelProperty(value = "手机")
    private String mobile;

    @ApiModelProperty(value = "电子邮件")
    private String email;

    @ApiModelProperty(value = "传真")
    private String fax;

    @ApiModelProperty(value = "机构网站网址")
    private String website;

    @ApiModelProperty(value = "拼音全拼")
    private String pinyin;

    @ApiModelProperty(value = "拼音首字母")
    private String pinyinInitial;

    /**
     * -1否，1是
     */
    @ApiModelProperty(value = "是否为目录")
    private Integer isDirectory;

    /**
     * -1否，1是
     */
    @ApiModelProperty(value = "是否独立机构")
    private Integer isUnit;

    @ApiModelProperty(value = "是否独立机构")
    private String isUnitText;

    /**
     * -1否，1是
     */
    @ApiModelProperty(value = "是否临时机构")
    private Integer isTemporary;

    @ApiModelProperty(value = "是否临时机构")
    private String isTemporaryText;

    /**
     * 1启用；-1停用
     */
    @ApiModelProperty(value = "状态")
    private Integer status;

    @ApiModelProperty(value = "状态")
    private String statusText;

    @ApiModelProperty(value = "行业条线")
    private String hytx;

    @ApiModelProperty(value = "地理区域")
    private String dlqy;

    @ApiModelProperty(value = "单位级别编号")
    private Integer orgLevel;

    @ApiModelProperty(value = "单位级别名称")
    private String orgLevelText;

    @ApiModelProperty(value = "机构职能")
    private String orgFunction;

    @ApiModelProperty(value = "显示顺序")
    private Integer showOrder;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "联系人")
    private String contactUser;

    @ApiModelProperty(value = "机构代码")
    private String unitCode;

    @ApiModelProperty(value = "域名")
    private String unitDomain;

    @ApiModelProperty(value = "智能柜标识")
    private String cabinetCode;

    @ApiModelProperty(value = "机构ID")
    private String unitId;

    /**
     * 是否主部门: 1是 -1否
     */
    @Transient
    private Integer ismain;

    public Map<String, Object> parseMap() {
        return null;
    }

    public String getId() {
        return id;
    }

    public void setId(Serializable id) {
        this.id = (String) id;
    }

    public Serializable getPrimaryKey() {
        return id;
        // return new Di_deptPK(id, id2); 用于复合主键，请手动创建内部静态类
    }

    public void setPrimaryKey(Serializable key) {
        this.id = (String) key;

        //Di_deptPK pk = (Di_deptPK) key; 用于复合主键
        //this.id = pk.getId();
        //this.id2 = pk.getId2();
    }

}
